Skip to content

Dag Run and Overview Tab Display Deadlines#62195

Open
imrichardwu wants to merge 20 commits intoapache:mainfrom
imrichardwu:error-ui-frontend
Open

Dag Run and Overview Tab Display Deadlines#62195
imrichardwu wants to merge 20 commits intoapache:mainfrom
imrichardwu:error-ui-frontend

Conversation

@imrichardwu
Copy link
Copy Markdown
Contributor

@imrichardwu imrichardwu commented Feb 19, 2026

blocked by #64926

PR scope change, so the branch name is a bit odd, but that's ok.

Implemented Dag run UI and Overview Tab base on the detail's at this PR(#50501 (comment))
Screenshot 2026-04-08 at 9 56 54 PM
Screenshot 2026-04-08 at 9 57 13 PM
Screenshot 2026-04-08 at 9 57 48 PM


Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

This commit introduces a new `FailedIcon` component for representing failure states in the UI, along with a plugin for the DurationChart that visually indicates failed indices. The `FailedIcon` is created using Chakra UI's icon system, while the plugin draws a custom icon on the chart for failed data points.
@imrichardwu
Copy link
Copy Markdown
Contributor Author

imrichardwu commented Feb 20, 2026

@vincbeck @bbovenzi @ferruzzi Please review :)

@ferruzzi
Copy link
Copy Markdown
Contributor

@pierrejeambrun this is the PR to actually implement that endpoint you modified in #62374, if you can review when you get time.

@ferruzzi
Copy link
Copy Markdown
Contributor

@imrichardwu - As I mentioned on Slack, I love how this looks in the screenshot, but the typescript/React stuff is well outside of my comfort zone to approve so I'll leave that for the others. The rendered result looks great to me though!

@pierrejeambrun pierrejeambrun added this to the Airflow 3.2.0 milestone Feb 25, 2026
Copy link
Copy Markdown
Member

@pierrejeambrun pierrejeambrun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice PR.

Overall looking good. Just a few suggestions/improvements.

Comment thread airflow-core/src/airflow/ui/src/assets/DeadlineIcon.tsx Outdated
Comment thread airflow-core/src/airflow/ui/src/assets/FailedIcon.tsx Outdated
Comment thread airflow-core/src/airflow/ui/src/components/DurationChart/failedIconPlugin.ts Outdated
Comment thread airflow-core/src/airflow/ui/src/layouts/Details/Grid/Bar.tsx Outdated
Comment thread airflow-core/src/airflow/ui/src/layouts/Details/Grid/Bar.tsx Outdated
Comment thread airflow-core/src/airflow/ui/src/layouts/Details/Grid/Bar.tsx Outdated
Comment thread airflow-core/src/airflow/ui/src/layouts/Details/Grid/constants.ts Outdated
@bbovenzi
Copy link
Copy Markdown
Contributor

I am struggling to understand the UX here.

  1. Adding a failed indicator on the grid run bar. Good call that we are missing a color blind friendly indicator here. But having the icon float above the bar and be a different icon than the "X" we've used for failed isn't the right solution. We could rethink where our run type icons go though.

  2. How many deadlines do we expect to exist on a single dag run at a time? I know the list endpoint has pagination but how often will we actually need it?

  3. The clock above the grid view feels out of context without much other UI for deadlines and deadline alerts.

Let me work on an issue for AIP-86's UI to make sure we are thinking this all through and developing enough API endpoints to support it.

@ferruzzi
Copy link
Copy Markdown
Contributor

How many deadlines do we expect to exist on a single dag run at a time? I know the list endpoint has pagination but how often will we actually need it?

I don't see user having more than a couple. I don't know what the actual average number will be, but my expectation is under 5. That's why I didn't think the pagination was a major miss in his original code, but it can't hurt to have either way.

The rest are UI/UX questions which aren't really my forte, I'll let you artists sort that part out, but I'll keep an eye here in case I can help at all.

@bbovenzi
Copy link
Copy Markdown
Contributor

I wrote up my thoughts over in AIP-86 UI issue.

@imrichardwu imrichardwu marked this pull request as draft February 26, 2026 01:07
- Introduce CalendarDeadlines component to display deadlines in the calendar view.
- Implement DeadlineAlertsBadge to show alerts related to deadlines in the DAG header.
- Create DagDeadlines component for overview page to list upcoming and missed deadlines.
- Add DeadlineStatus component to show the status of deadlines in the run details.
- Enhance i18n support for new deadline-related strings in dag.json.
@imrichardwu imrichardwu marked this pull request as ready for review April 2, 2026 17:22
@imrichardwu imrichardwu requested a review from ashb as a code owner April 2, 2026 17:22
@imrichardwu imrichardwu changed the title Calendar and Overview Tab Display Deadlines Dag Run and Overview Tab Display Deadlines Apr 2, 2026
@imrichardwu imrichardwu requested a review from bbovenzi April 2, 2026 21:42
Comment thread airflow-core/src/airflow/ui/src/pages/Run/DeadlineStatus.tsx
@imrichardwu imrichardwu requested a review from bbovenzi April 3, 2026 19:40
@potiuk potiuk added the ready for maintainer review Set after triaging when all criteria pass. label Apr 6, 2026
Copy link
Copy Markdown
Contributor

@bbovenzi bbovenzi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Testing this all manually and I find the UX to still be a bit confusing. Let me try to provide some guidance.

  1. Let's move all the python work in this PR to a separate PR that we merge before this. Then we can just focus on the UI here.

  2. We can't rely on the name and description to tell a user what the alerts and deadlines are. We can do a better job of interpreting the reference and interval. For all cases of Met, Pending, and Missed. We should compare the alert's expected vs the dag run's actual. eg "Expected dag run finish: 1 hr after logical date. Actual dag run finish: 2 hours after logical date".

  3. In the dag overview page, let's include the state of the dag run with each deadline so that I can, at a glance, know things like "Running dag with a missed deadline", "Successful run with a missed deadline"

Just showing a dag run id and a date is not sufficient information for a user to know what is going on.

Image Image Image Image

Comment thread airflow-core/src/airflow/ui/src/pages/Run/DeadlineStatus.tsx
Comment thread airflow-core/src/airflow/ui/src/pages/Dag/Overview/DagDeadlines.tsx
Comment thread airflow-core/src/airflow/ui/src/pages/Run/DeadlineStatus.tsx Outdated
Comment thread airflow-core/src/airflow/ui/src/pages/Dag/DeadlineAlertsBadge.tsx Outdated
Comment thread airflow-core/src/airflow/ui/src/pages/Dag/DeadlineAlertsBadge.tsx Outdated
Comment thread airflow-core/src/airflow/ui/src/pages/Run/DeadlineStatus.tsx
Comment thread airflow-core/src/airflow/ui/src/pages/Run/DeadlineStatus.tsx Outdated
Comment thread airflow-core/src/airflow/ui/src/pages/Dag/DeadlineAlertsBadge.tsx Outdated
Comment thread airflow-core/src/airflow/ui/src/pages/Dag/DeadlineAlertsBadge.tsx Outdated
Copy link
Copy Markdown
Contributor

@bbovenzi bbovenzi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing the human readable changes. I would still prefer that we split the python and UI changes into separate PRs.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file looks like a mistake?

Copy link
Copy Markdown
Contributor Author

@imrichardwu imrichardwu Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I split the pr. I should had @ you. And I do not think that is a mistake because the pre commit hook did that. I’m not too sure why cuz I tried getting rid of it every time and it just keeps creating it when I commit. I mention it in my note in the pr because I was kinda confuse why it did that.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, thanks I reviewed this before I saw your other PR.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can make this one change and skip the pre-commit checks with --no-verify

@kaxil kaxil requested a review from Copilot April 10, 2026 19:55
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated 6 comments.

Comments suppressed due to low confidence (1)

airflow-core/src/airflow/serialization/encoders.py:170

  • This PR is focused on UI changes for displaying DAG run deadlines, but it also modifies core trigger serialization behavior. Since this change is unrelated to the stated scope and could have broad impact on DAG serialization/deserialization, it would be safer to either justify the necessity in the PR description or move it into a separate PR with its own tests/validation.
def encode_trigger(trigger: BaseEventTrigger | dict):
    from airflow.serialization.serialized_objects import BaseSerialization

    def _ensure_serialized(d):
        """
        Make sure the kwargs dict is JSON-serializable.

        This is done with BaseSerialization logic. A simple check is added to
        ensure we don't double-serialize, which is possible when a trigger goes
        through multiple serialization layers.
        """
        if isinstance(d, dict) and Encoding.TYPE in d:
            return d
        return BaseSerialization.serialize(d)

    if isinstance(trigger, dict):
        classpath = trigger["classpath"]
        kwargs = trigger["kwargs"]
    else:
        classpath, kwargs = trigger.serialize()
    return {
        "classpath": classpath,
        "kwargs": {k: _ensure_serialized(v) for k, v in kwargs.items()},
    }

Comment thread airflow-core/src/airflow/ui/src/pages/Dag/Overview/DagDeadlines.tsx
Comment thread airflow-core/src/airflow/ui/src/pages/Dag/DeadlineAlertsBadge.tsx
Comment thread airflow-core/src/airflow/ui/src/pages/Run/DeadlineStatus.tsx Outdated
Comment thread airflow-core/src/airflow/ui/src/pages/Run/DeadlineStatus.tsx Outdated
Comment on lines +98 to +103
{deadlines.map((dl) => {
const alert =
dl.alert_name !== undefined && dl.alert_name !== null && dl.alert_name !== ""
? alertMap.get(dl.alert_name)
: undefined;
const deadlineTime = dayjs(dl.deadline_time);
Copy link

Copilot AI Apr 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The modal resolves dl.alert_name to a DeadlineAlertResponse via alertMap keyed on alert name. Since DeadlineAlert.name is nullable and not guaranteed unique, this lookup can be incorrect (collisions/overwrites) and show the wrong completion rule. Prefer using a stable identifier (e.g., alert UUID) from the deadline payload to map alerts to deadline instances.

Copilot uses AI. Check for mistakes.
Comment on lines +102 to +108
const alertMap = new Map<string, DeadlineAlertResponse>();

for (const alert of alertData?.deadline_alerts ?? []) {
if (alert.name !== undefined && alert.name !== null && alert.name !== "") {
alertMap.set(alert.name, alert);
}
}
Copy link

Copilot AI Apr 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alertMap is keyed by alert.name and used to resolve deadline instances by dl.alert_name. Since DeadlineAlert.name is not enforced to be unique, this can mis-associate alerts when duplicate names exist. Prefer keying by a stable identifier (alert UUID) and consider updating the deadline API response to include the alert id so the UI can join reliably.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:translations area:UI Related to UI/UX. For Frontend Developers. ready for maintainer review Set after triaging when all criteria pass. translation:default

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants